<template>
	<div class="public_m1">
	        	<div class="public_m2">资料管理</div>
	            <!--照片和内容-->	
	            <div class="zp_nrm">
	            	<!--left-->
	                <div class="zp_nrm_l">
	                	<img src="https://ts1.cn.mm.bing.net/th/id/R-C.3aeeb6d5725738095a7ad521d46ce428?rik=prLV4puYz%2btYuw&riu=http%3a%2f%2fwww.gx8899.com%2fuploads%2fallimg%2f2018021008%2fjrmgrhcgro0.jpg&ehk=Im%2fy1GA0xuqdwYNnKtzfue2b09jzjym4jjUXy7e0Seo%3d&risl=&pid=ImgRaw&r=0">
	                </div>
	                <!--right-->
	                <div class="form-item">
	                	<p><em>邮箱：</em><input type="text" v-model="form.account" placeholder="邮箱"></p>
	                    <p><em>昵称：</em><input type="text" v-model="form.name" placeholder="昵称"></p>
	                    <p><em>手机号：</em><input type="text" v-model="form.phone" placeholder="手机号"></p>
	                    <p><em>性别：</em>
                        <el-radio v-model="form.gender" label="男">男</el-radio>
                        <el-radio v-model="form.gender" label="女">女</el-radio>
                      </p>

	                    <p><em>生日：</em><el-date-picker
                          v-model="form.birthday"
                          type="datetime"
                          placeholder="选择日期时间">
                      </el-date-picker></p>
	                   <p><em>地址：</em><input type="text" v-model="form.address" placeholder="地址"></p>
	                    <a href="" class="public_m3" @click="save()">保存修改</a>
	                </div>
	            </div>
	        </div>
</template>

<script>
import Index from "@/views/front/Index";
import router from "@/router";
export default {
  components: {Index},
  data(){
    return{
      form:{
        id:"",
        account:"1503608495@qq.com",
        name:"",
        phone:"",
        gender:"",
        password:"",
        address:"",
        yzm:"",
        birthday:''
      },
    }
  },
  methods:{
      save(){
        this.$http.post("userCenter/userCtl/update",this.form).then((resp)=>{
          // alert("111")
          if (resp.data.code==200){
            this.$message({
              showClose: true,
              message: '恭喜你，修改成功✔',
              type: 'success'
            });
          }
        })
      },

  },
  mounted() {
      this.$http.get("userCenter/userCtl/information").then((resp)=>{
        // alert("111")
        if (resp.data.code==200){
              this.form.account = resp.data.data.account;
              this.form.id = resp.data.data.id;
              this.form.phone = resp.data.data.phone;
              this.form.gender = resp.data.data.gender;
              this.form.address = resp.data.data.address;
              this.form.name = resp.data.data.name;
              this.form.birthday = resp.data.data.birthday;
          }
      })
  }
}
</script>
<style src="../../assets/css/center.css" scoped></style>
